package ma.fizazi.missionsmanagement.business.commons.impl;

import ma.fizazi.missionsmanagement.business.commons.CommonBusiness;
import ma.fizazi.missionsmanagement.dao.commons.DAOServices;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service("commonBusiness")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public class CommonBusinessImpl implements CommonBusiness {

	@Autowired
	DAOServices daoServices;

	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	public void saveEntity(Object entity) {
		daoServices.saveEntity(entity);
	}

	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	public void deleteEntity(Object entity) {
		daoServices.deleteEntity(entity);
	}

	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	public void mergeEntity(Object entity) {
		daoServices.mergeEntity(entity);
	}

	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	public void updateEntity(Object entity) {
		daoServices.updateEntity(entity);
	}

}